package com.ecommerce.order.service;

import com.ecommerce.common.core.ApiResult;
import com.ecommerce.common.core.PageResult;
import com.ecommerce.order.dto.CreateOrderRequest;
import com.ecommerce.order.dto.OrderInfo;
import com.ecommerce.order.dto.OrderQueryRequest;
import com.ecommerce.order.dto.OrderResponse;

/**
 * 订单服务接口
 */
public interface OrderService {

    /**
     * 创建订单
     */
    ApiResult<OrderResponse> createOrder(Long userId, CreateOrderRequest request);

    /**
     * 获取订单详情
     */
    ApiResult<OrderResponse> getOrderDetail(Long userId, Long orderId);

    /**
     * 分页查询用户订单
     */
    ApiResult<PageResult<OrderResponse>> pageUserOrders(Long userId, OrderQueryRequest request);

    /**
     * 取消订单
     */
    ApiResult<Void> cancelOrder(Long userId, Long orderId);

    /**
     * 确认收货
     */
    ApiResult<Void> confirmReceive(Long userId, Long orderId);

    /**
     * 订单支付成功回调
     */
    ApiResult<Void> paymentSuccess(String orderNo, String paymentNo);

    /**
     * 订单发货
     */
    ApiResult<Void> shipOrder(Long orderId, String trackingNo);
    /**
     * 根据订单号查询订单
     */
    OrderInfo getOrderByNo(String orderNo);
}
